<?php


// +----------------------------------------------------------------------
// | EasyAdmin
// +----------------------------------------------------------------------
// | PHP交流群: 763822524
// +----------------------------------------------------------------------
// | 开源协议  https://mit-license.org
// +----------------------------------------------------------------------
// | github开源项目：https://github.com/zhongshaofa/EasyAdmin
// +----------------------------------------------------------------------

namespace app\common\model;

use app\common\business\Member;
use app\common\model\TimeModel;


class MallOrder extends TimeModel
{

    protected function getEndTimeAttr($value)
    {
        $shoptime =(new Member())->getSystenConfig('shoptime');

        $time = time();
        $end_time = $value + $shoptime*60;
        $left_time = $end_time - $time;
        $day = intval($left_time / 86400);//天
        $hour = intval((($left_time / 86400) - $day) * 24);//小时
        $minute = intval((((($left_time / 86400) - $day) * 24) - $hour) * 60);//分钟
        $second = intval(((((((($left_time / 86400) - $day) * 24) - $hour) * 60) - $minute) * 60));//秒
        return $minute . '分钟' . $second . '秒';
    }

}